# -*-coding:utf-8-*-
import logging
from django.core.mail import send_mail
from django.conf import settings
from django.http import request, JsonResponse

from apps.users.utils import generate_verify_email_url
from celery_tasks import email
from celery_tasks.main import app

logger = logging.getLogger('django')

@app.task(name = 'send_verify_email')
def send_verify_email(subject,message,from_email,recipient_list,html_message):
    send_mail(subject=subject,
              message=message,
              from_email=from_email,
              recipient_list=recipient_list,
              html_message=html_message)
    # 响应添加邮箱结果
    return JsonResponse({'code': 0, 'errmsg': '添加邮箱成功'})
